FOOTBALL ANALYTICS — SOCCERRATING IMPORTER V1
===========================================
Release: importer-review-integration-v1 (2026-11-13)

IMPORTANT STATUS
----------------
Import Review Queue, strategy-to-sheet routing, logo reuse, duplicate history,
manual approval, phone push subscription screens and notification history are
implemented. They were verified using synthetic test data.

The live SoccerRating authenticated connector is EXPERIMENTAL AND NOT VERIFIED
against your actual saved strategies. Its selector and upcoming match parser
must be tested on your account before the 60-minute scheduler can be enabled.
No hourly checks or Web Push notifications are claimed active in this ZIP.

STARTING
--------
1. Keep your previous working ZIP as a full backup.
2. Extract this ZIP to a NEW FOLDER. Do not overwrite your old working app.
3. Start Football Analytics as usual.
4. Open the new 'SoccerRating Importer' link from the sidebar.
5. For optional authenticated website collection and Web Push, run
   INSTALL_SOCCERRATING_OPTIONAL_COMPONENTS.bat on Windows (requires internet).
6. Select 'Connect SoccerRating' from the desktop app. It opens a new Microsoft
   Edge browser profile pointed at soccer-rating.com. Sign in THERE using the
   website's login form, not inside Football Analytics. Close the browser
   completely before selecting 'Check Now'. The login session is stored only
   in the local browser profile under soccerrating_browser_profile.
7. Click Check Now and inspect the reported result. If it reports that the
   saved-strategy selectors or Betting Picks format changed, DO NOT enable
   automated checking. The connector needs adaptation from a sanitized HTML
   sample of the exact logged-in Betting Picks table.
8. After a successful authenticated scan, you can enable checks every 60 min.
   Desktop must be running with network access. Failed login pauses scanning
   and no fabricated matches are inserted.
9. League and country are optional in the Review Queue. You may leave both
   blank, approve the match, and enter its league later via Edit Match.
   Optionally upload missing team logos; existing team logos are reused by
   matching normalized team names. Click 'Approve & Import' to save to SQLite.
10. The created match is 'Upcoming' without score/result. It participates in
    statistics only after normal settlement.

NOTIFICATIONS
-------------
1. On desktop, enter a REAL contact email for Web Push and choose 'Set up'.
2. On your HTTPS Tailscale phone web app, choose 'Enable on this phone' and
   grant notifications. For iOS, it must be installed to Home Screen.
3. Choose 'Send Test Alert'. Check the message and notification history.
4. Every collection is compared with the persistent queue and master registry.
   Old, imported and dismissed fixtures NEVER generate repeat new-match alerts.
   An odds change alone does not define a new fixture.
5. If a push subscription is unavailable or phone is offline, delivery cannot
   be guaranteed. The history and Review Queue still retain the discoveries.
6. In desktop HTML WebView, browser Push may not be supported; subscribe on
   the Android/iOS PWA using HTTPS through your private Tailscale address.

SECURITY AND SOURCE REQUIREMENTS
--------------------------------
- Website credentials are entered into SoccerRating in Edge, not this app.
- Do not give this tool your SoccerRating password or bypass CAPTCHA, access
  controls, website restrictions or rate limits. Obtain permission where needed.
- The authenticated connector is conservative: if it cannot identify each
  exact saved-strategy link or read Betting Picks unambiguously, it aborts.
- The collector never reads Last 250 Matches or scores.
- No source data is registered into the master Match Registry automatically.
- Your original SQLite database and workbook remain untouched by merely
  collecting matches; they change only when you approve an import.
- The separate soccerrating_queue.db is created after running the app.
- Never delete the queue DB, browser profile or Web Push credentials if they
  contain discoveries/subscriptions you wish to keep.
- Exclude private_soccerrating_vapid.pem and the Edge profile from backups
  shared with others; keep both only in trusted local backups.

LIMITATIONS
-----------
The site layout, account session, permission to automate and background Web
Push delivery could not be tested without access to your authenticated account
and physical phone. The included browser connector is optional, not a promise
of unattended collection. Manual JSON capture is offered as a safe fallback.
